package com.weds.frame.domain.util;

import cn.hutool.core.lang.Snowflake;

import java.io.Serializable;

/**
 * Description:
 * Author: LiuWenQing
 * Datetime: 2023/4/20 13:09
 */
public class SnowflakeIdGenerator {

    private final Snowflake snowflake;

    public Serializable nextId(Object entity) {
        return nextId();
    }

    public Long nextId() {
        return snowflake.nextId();
    }

    public SnowflakeIdGenerator(long workerId, long dataCenterId) {
        this.snowflake = new Snowflake(workerId, dataCenterId);
    }

}
